import * as constants from './constants.js'

const defaultState = {
  isLogin: true
}

export default (state = defaultState, action) => {
  switch (action.type) {
    case constants.LOGIN_STATUS:
      return {
        ...state,
        isLogin: action.payload
      }
    case constants.LOGIN:
      return {
        ...state,
        isLogin: action.payload
      }
    case constants.LOGOUT:
      return {
        ...state,
        isLogin: action.payload
      }
    default:
      return state;
  }
}